package equipment;

import java.awt.Button;

import main.Equipment;
import main.Utils;

// Notes on unsupported cavalry rules:
//   Cavalry automatically flee when rider is thrown

public class Mount extends Equipment {
	public int strength = 3;
	public int defense = 4;
	public int attacks = 0;
	public int wounds = 1;
	
	public void takeStrike(int roll, int strength, Button doneStriking) {
		if (!Utils.wound(roll, strength, this.getDefense())) {
			return;
		}
		else {
			// For now, assuming mounts don't have complicated wound-taking rules nor fate for saves
			this.wounds -= 1;
			if (this.wounds <= 0) {
				this.owner.throwRider(doneStriking);
			}
		}
	}
	
	public int getDefense() {
		return defense;
	}
}
